diff options
| author | Adam Soltys <[email protected]> | 2022-10-06 01:00:01 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-06 01:00:01 -0700 |
| commit | f5f66a19257680f049e7bc352eac67fcfadde7e8 (patch) | |
| tree | fe3595e4b09ca3207b47c410f5b8c8eac76be20c /src/routes/send/user/[username]/+page.svelte | |
| parent | 80b15a87ec3d92f9911706f079723a2743e3bb2e (diff) | |
| download | coinos-ui-f5f66a19257680f049e7bc352eac67fcfadde7e8.tar.gz coinos-ui-f5f66a19257680f049e7bc352eac67fcfadde7e8.zip | |
pass amount to send route
Diffstat (limited to 'src/routes/send/user/[username]/+page.svelte')
| -rw-r--r-- | src/routes/send/user/[username]/+page.svelte | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/routes/send/user/[username]/+page.svelte b/src/routes/send/user/[username]/+page.svelte deleted file mode 100644 index ed6a9f17..00000000 --- a/src/routes/send/user/[username]/+page.svelte +++ /dev/null @@ -1,84 +0,0 @@ -<script> - import { selectedRate } from '$lib/store'; - import { enhance } from '$app/forms'; - import { Icon, Numpad, Spinner } from '$comp'; - import { page } from '$app/stores'; - import { back, f, s, sats } from '$lib/utils'; - export let data; - export let form; - - let { recipient, user } = data; - let { currency } = user; - - let amount = form?.amount || data.amount; - let a, - af, - amountFiat, - fiat = true; - - let setAmount = () => { - console.log('setting', a, af); - amount = a; - amountFiat = af; - }; - - let handleBack = () => { - if (amount) amount = undefined; - else back(); - }; - - let loading; - let submit = () => (loading = true); -</script> - -<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" on:click={handleBack}> - <Icon icon="arrow-left" style="w-10" /> -</button> - -<div class="container px-4 mt-20 max-w-xl mx-auto"> - {#if amount} - <div class="text-center mb-8"> - <h1 class="text-xl md:text-2xl text-secondary mb-2">Send</h1> - <p class="text-6xl break-words mb-4"> - {fiat ? f(amountFiat, currency) : s(a)} - {#if !fiat} - <span class="text-xl md:text-2xl text-secondary">sats</span> - {/if} - </p> - - <h1 class="text-xl md:text-2xl text-secondary mb-2">to</h1> - <p class="text-6xl break-words">{recipient.username}</p> - </div> - {:else} - <Numpad bind:amount={a} bind:amountFiat={af} {currency} bind:fiat /> - {/if} - - <form method="POST" use:enhance on:submit={submit}> - <input name="amount" value={amount} type="hidden" /> - <input name="username" value={recipient.username} type="hidden" /> - <input name="confirmed" value={form?.confirm} type="hidden" /> - - <div class="flex w-full"> - {#if amount} - <button - type="submit" - class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24" - > - {#if loading} - <Spinner /> - {:else} - Send - {/if} - </button> - {:else} - <button - type="button" - class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24" - on:click={setAmount} - > - Next - </button> - {/if} - </div> - </form> -</div> |
